package nuc.edu.tlias.controller;

import lombok.extern.slf4j.Slf4j;
import nuc.edu.tlias.pojo.OperateLog;
import nuc.edu.tlias.pojo.PageResult;
import nuc.edu.tlias.pojo.Result;
import nuc.edu.tlias.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/log")
public class LogController {
    @Autowired
    LogService logService;

    @GetMapping("/page")
    public Result findall(Integer page, Integer pageSize){

        log.info("请求参数：{} {}",page,pageSize);
        PageResult<OperateLog> logPageResult = logService.findall( page,pageSize);
        return Result.success(logPageResult);
    }

}
